package com.yuki.fwwb.Controller;


import com.yuki.fwwb.Entity.Weather;
import com.yuki.fwwb.Service.WeatherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "天气")
@RestController
public class WeatherController {

    @Autowired
    WeatherService weatherService;

    @ApiOperation(value = "查询单独每天的天气情况  查询格式 06 01  即2020-6-1")
    @PostMapping("/findWeatherByDay")
    public Weather findWeatherByDay(String month,
                                    String day) {
        return weatherService.findWeatherByDay(month, day);
    }


    @ApiOperation(value = "查询单独一个月的天气情况  查询格式 06 即2020-06")
    @PostMapping("/findWeatherByMonth")
    public List<Weather> findWeatherByDay(String month) {
        return weatherService.findWeatherByMonth(month);
    }
}
